<!-- content start -->
<div class="admin-content">
	<div class="am-cf am-padding">
		<div class="am-fl am-cf">
			<strong class="am-text-primary am-text-lg">管理员列表</strong> / <small>Administrators</small>
		</div>
	</div>

	<hr />

	<div class="am-g">
		<div class="am-u-sm-12 am-u-md-6">
			<div class="am-btn-toolbar">
				<div class="am-btn-group am-btn-group-xs">
					<button type="button" data-ng-click="newAdminUI()" class="am-btn am-btn-default">
						<span class="am-icon-plus"></span> 新增
					</button>
					<!-- <button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button> -->
				</div>
			</div>
		</div>
	</div>

	<hr />

	<div class="am-g">
		<div class="am-u-sm-12">
			<form class="am-form">
				<table class="am-table am-table-striped am-table-hover table-main">
					<thead>
						<tr>
							<!-- <th class="table-check"><input type="checkbox" /></th> -->
							<th class="table-id">ID</th>
							<th class="table-username">用户名</th>
							<th class="table-name">姓名</th>
							<th class="table-sex">性别</th>
							<th class="table-birthday">生日</th>
							<!-- 	<th class="table-phone">兴趣爱好</th> -->
							<th class="table-job">工作</th>
							<th class="table-income">收入</th>
							<th class="table-phone">电话号码</th>
							<th class="table-address">地址</th>
							<th class="table-date">创建日期</th>
							<th class="table-set">操作</th>
						</tr>
					</thead>
					<tbody>
						<tr data-ng-repeat="admin in page.recordList">
							<!-- <td><input type="checkbox" /></td> -->
							<td>{{admin.id}}</td>
							<td>{{admin.username}}</td>
							<td>{{admin.name}}</td>
							<td>{{admin.sex}}</td>
							<td>{{admin.birthday | date : 'yyyy-MM-dd' }}</td>
							<!-- <td>{{admin.interests}}</td> -->
							<td>{{admin.job}}</td>
							<td>{{admin.income}}</td>
							<td>{{admin.phone}}</td>
							<td>{{admin.address}}</td>
							<td>{{admin.createTime | date : 'yyyy-MM-dd HH:mm' }}</td>
							<td>
								<div class="am-btn-toolbar">
									<div class="am-btn-group am-btn-group-xs">
										<button class="am-btn am-btn-default am-btn-xs am-text-secondary" data-ng-click="showEdit(admin)">
											<span class="am-icon-pencil-square-o"></span> 编辑
										</button>
										<button class="am-btn am-btn-default am-btn-xs am-text-secondary" data-ng-click="showSetRoles(admin)">
											<span class="am-icon-pencil-square-o"></span> 设置权限
										</button>
										<button data-ng-click="deleteById(admin)" class="am-btn am-btn-default am-btn-xs am-text-danger">
											<span class="am-icon-trash-o"></span> 删除
										</button>
									</div>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
				<div class="am-cf" ng-model="total">
					共&nbsp;{{page.recordCount}}&nbsp;条记录
					<div class="am-fr">
						<ul class="am-pagination">
							<li><a href="javascript:void(0);" data-ng-click="prePage(page);">上一页</a></li>
							<li class="am-disabled"><a href="javascript:void(0);">{{page.currentPage}}</a></li>
							<li><a href="javascript:void(0);" data-ng-click="nextPage(page);">下一页</a></li>
						</ul>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<!-- content end -->
<!-- 侧边栏内容 -->
<div id="roles_ui" class="am-offcanvas">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 300px;">
		<div class="am-offcanvas-content">
			<form class="am-form">
				<fieldset>
					<legend style="color: white;">设置权限</legend>
					<div class="am-form-group">
						<div class="am-checkbox" ng-repeat="role in roles">
							<label> <input type="checkbox" name="ids" value="{{role.id}}" data-ng-model="rolesChecked[$index]"> {{role.description}}
							</label>
						</div>
					</div>
					<div class="am-form-group">
						<div class="am-u-sm-9">
							<button type="button" class="am-btn am-btn-primary am-btn-xs" data-ng-click="setRoles()">提交</button>
							<button type="button" class="am-btn am-btn-primary am-btn-xs" data-ng-click="closeRolesUI()">关闭</button>
						</div>
					</div>
				</fieldset>
			</form>
		</div>
	</div>
</div>


<div id="edit_ui" class="am-offcanvas">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 500px;">
		<div class="am-offcanvas-content">

			<form class="am-form am-form-horizontal" data-am-validator>
				<fieldset>
					<legend style="color: white;">信息编辑</legend>
					
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<img data-ng-src="{{ admin.image? baseUrl+admin.image+formatImage:'sad.png' }}"> 
							<input required type="file" ng-file-select="newAdminImage($files)" />
						</div>
					</div>
					
					<!-- 姓名 -->
					<div class="am-form-group">
						<label for="admin-name" class="am-u-sm-3 am-form-label">姓名<span style="color: red;">*</span></label>
						<div class="am-u-sm-9">
							<input required class="form-control" type="text" id="admin-name" placeholder="姓名 / Name" ng-model="admin.name"> <small ng-model="admin.name">输入你的名字，让我们记住你。</small>
						</div>
					</div>

					<!-- 性别 -->
					<div class="am-form-group">
						<label class="am-u-sm-3 am-form-label">性别<span style="color: red;">*</span></label>
						<div class="am-u-sm-9">
							<label class="am-radio-inline"> <input type="radio" name="sex" value="male" required ng-model="admin.sex"> <small>我是男孩</small>
							</label> <label class="am-radio-inline"> <input type="radio" name="sex" value="female" ng-model="admin.sex"> <small>我是女孩</small>
							</label>
						</div>
					</div>


					<!-- 兴趣爱好 -->
					<!-- <div class="am-form-group">
						<label for="admin-interests" class="am-u-sm-3 am-form-label">兴趣爱好</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-interests" placeholder="输入你的兴趣爱好 / Interests" ng-model="admin.interests"> <small>您的兴趣爱好是什么呢？</small>
						</div>
					</div> -->

					<!-- 工作 -->
					<div class="am-form-group">
						<label for="admin-job" class="am-u-sm-3 am-form-label">工作</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-job" placeholder="输入你的工作描述 / Job" ng-model="admin.job"> <small>方便的话告诉我们您的工作好么？</small>
						</div>
					</div>

					<!-- 收入 -->
					<div class="am-form-group">
						<label for="admin-income" class="am-u-sm-3 am-form-label">收入</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-income" placeholder="请输入您的收入 / Income" ng-model="admin.income">
						</div>
					</div>

					<!-- 电话 -->
					<div class="am-form-group">
						<label for="admin-phone" class="am-u-sm-3 am-form-label">电话</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-phone" placeholder="输入电话号码 / Telephone" ng-model="admin.phone">
						</div>
					</div>

					<!-- 地址 -->
					<div class="am-form-group">
						<label for="admin-address" class="am-u-sm-3 am-form-label">地址</label>
						<div class="am-u-sm-9">
							<textarea class="text" rows="5" id="admin-address" placeholder="请输入地址" ng-model="admin.address"></textarea>
						</div>
					</div>

					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<button type="button" class="am-btn am-btn-primary" ng-click="updateInfo(admin);">保存</button>
							<button type="button" class="am-btn am-btn-primary" ng-click="closeEditUI(admin);">关闭</button>
						</div>
					</div>
				</fieldset>
			</form>

		</div>
	</div>
</div>

<div id="new_ui" class="am-offcanvas">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 500px;">
		<div class="am-offcanvas-content">

			<form class="am-form am-form-horizontal" data-am-validator>
				<fieldset>
					<legend style="color: white;">信息编辑</legend>

					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<img data-ng-src="{{ admin.image? baseUrl+admin.image+formatImage:'sad.png' }}"> 
							<input required type="file" ng-file-select="newAdminImage($files)" />
						</div>
					</div>

					<!-- 姓名 -->
					<div class="am-form-group">
						<label for="admin-name" class="am-u-sm-3 am-form-label">姓名<span style="color: red;">*</span></label>
						<div class="am-u-sm-9">
							<input required class="form-control" type="text" id="admin-name" placeholder="姓名 / Name" ng-model="admin.name"> <small ng-model="admin.name">输入你的名字，让我们记住你。</small>
						</div>
					</div>

					<!-- 性别 -->
					<div class="am-form-group">
						<label class="am-u-sm-3 am-form-label">性别<span style="color: red;">*</span></label>
						<div class="am-u-sm-9">
							<label class="am-radio-inline"> <input type="radio" name="sex" required value="male" ng-model="admin.sex"> <small>我是男孩</small>
							</label> <label class="am-radio-inline"> <input type="radio" name="sex" value="female" ng-model="admin.sex"> <small>我是女孩</small>
							</label>
						</div>
					</div>

					<!-- 兴趣爱好 -->
					<!-- <div class="am-form-group">
						<label for="admin-interests" class="am-u-sm-3 am-form-label">兴趣爱好</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-interests" placeholder="输入你的兴趣爱好 / Interests" ng-model="admin.interests"> <small>您的兴趣爱好是什么呢？</small>
						</div>
					</div> -->

					<!-- 工作 -->
					<div class="am-form-group">
						<label for="admin-job" class="am-u-sm-3 am-form-label">工作</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-job" placeholder="输入你的工作描述 / Job" ng-model="admin.job"> <small>方便的话告诉我们您的工作好么？</small>
						</div>
					</div>

					<!-- 收入 -->
					<div class="am-form-group">
						<label for="admin-income" class="am-u-sm-3 am-form-label">收入</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-income" placeholder="请输入您的收入 / Income" ng-model="admin.income">
						</div>
					</div>

					<!-- 电话 -->
					<div class="am-form-group">
						<label for="admin-phone" class="am-u-sm-3 am-form-label">电话</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-phone" placeholder="输入电话号码 / Telephone" ng-model="admin.phone">
						</div>
					</div>

					<!-- 地址 -->
					<div class="am-form-group">
						<label for="admin-address" class="am-u-sm-3 am-form-label">地址</label>
						<div class="am-u-sm-9">
							<textarea class="text" rows="5" id="admin-address" placeholder="请输入地址" ng-model="admin.address"></textarea>
						</div>
					</div>

					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<button type="button" class="am-btn am-btn-primary" ng-click="newAdmin(admin);">保存</button>
							<button type="button" class="am-btn am-btn-primary" ng-click="closeNewUI();">关闭</button>
						</div>
					</div>
				</fieldset>
			</form>

		</div>
	</div>
</div>


